<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			
			// Object对象
			
			// 1. 创建对象
		
			
			var stu = {};
			stu.id = 1;
			stu.name = "张三";
			stu.age = 18;
			console.log(stu.id+","+stu.name);
			console.log(stu);
			console.log(stu.constructor);
			
			var stu2 = {
				id:2,
				name:"李四",
				age:"19"
			}
			console.log(stu2.id+","+stu2.name);
			
			var stu3 = {};
			stu3["id"] = 3;
			stu3["name"] ="王五";
			stu3["age"] = 18;
			console.log(stu3.id+","+stu3.name);
			
			// 练习1
			// 新建一个对象，保存如下商品信息:
			// 商品编号 1001 
			// 商品名   "iphone15""
			// 商品价格 8888
			// 商品颜色	玫瑰金
			
			var person = {
				firstName: "Mike",
				lastName:"Jackson",
				fullName: function()
				{
					return this.firstName + " " +this.lastName;
				}
			}
			
			console.log(person.fullName())
			
			
			
			
			
		</script>
		
		
	</body>
</html>